package com.podcstr.entity;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * @author azim
 * @since 5/26/13 
 */

@Entity
@Table(name = "tb_files")
@NamedQueries(value = {
        @NamedQuery(name = "tb_files.delete", query = "DELETE  FROM MediaFile u WHERE u.id =:id"),
        @NamedQuery(name = "tb_files.findById", query = "SELECT u FROM MediaFile u WHERE u.id =:id")
})
public class MediaFile extends PersistanceObject {

    @NotNull
    private String name;

    @NotNull
    private String contentType;

    @Lob
    @NotNull
    private byte[] content;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }
}
